import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBEngineer/YBBaseRouter/YBApplication.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBColor/YBColor.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBImageStyle/YBImageStyle.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBTextStyle/YBTextStyle.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/yb_chinese_text/yb_chinese_text.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBJsonToModel/YBMineModel/YBMineZuZhiManagerPersonModel.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBModule/YBMineModule/YBMineProvider/YBMineZuZhiManagerProvider.dart';

class YBZhuZhiManagerPage extends StatelessWidget {

  final String userInfoModel;

  const YBZhuZhiManagerPage({Key key, this.userInfoModel}) : super(key: key);

  @override
  Widget build(BuildContext context) {

    String _orginName = '';

    return Container(
        child: Scaffold(
          appBar: AppBar(
            elevation: 0,
            title: Text(
              YBChineseText.mineZuZhiManagerTitle,
              style: YBTextStyle.TextStyle30313320Medium,
            ),
          ),
          body: ChangeNotifierProvider(
            create: (context) => YBMineZuZhiManangerProvider()..getMineZuZhiManagerData(),
            child: Consumer<YBMineZuZhiManangerProvider>(
                builder: (context,zuZhiManagerModel,child){
                  if (zuZhiManagerModel.zuZhiManangerModel != null){
                    _orginName = zuZhiManagerModel.zuZhiManangerModel.orgName;
                    if (!ObjectUtil.isEmptyList(zuZhiManagerModel.zuZhiManangerModel.customerMembers)) {
                      YBMineZuZhiManangerPersonModel zuZhiMangerPersonModel = zuZhiManagerModel.zuZhiManangerModel.customerMembers[0];
                    }
                  }
                  return SingleChildScrollView(
                    child: Column(
                      mainAxisAlignment: MainAxisAlignment.start,
                      crossAxisAlignment: CrossAxisAlignment.stretch,
                      children: [
                        Container(
                          height: YBTextStyle.adapterSize8,
                        ),
                        InkWell(
                          child: Container(
                            height: YBTextStyle.adapterSize88,
                            color: YBColor.white,
                            child: Padding(
                              padding: EdgeInsets.only(left:YBTextStyle.adapterSize20,right:YBTextStyle.adapterSize20),
                              child: Container(
                                child: Row(
                                  children: [
                                    Container(
                                      child: Image.asset(YBImageStyle.getImagePath('mine_teamInfo')),
                                    ),
                                    Container(
                                      width: YBTextStyle.adapterSize12,
                                    ),
                                    Expanded(
                                      child: Column(
                                        mainAxisAlignment: MainAxisAlignment.center,
                                        crossAxisAlignment: CrossAxisAlignment.start,
                                        children: [
                                          Container(
                                            child: Text(
                                              _orginName??"",
                                              style: YBTextStyle.TextStyle2F303316Medium,
                                            ),
                                          ),
                                          Container(
                                            height: YBTextStyle.adapterSize15,
                                          ),
                                          Container(
                                            child: Text(
                                            YBChineseText.mineWoZuZhiMangerNameTitle,
                                              style: YBTextStyle.TextStyle90939912,
                                            ),
                                          ),
                                        ],
                                      ),
                                    ),
                                    Container(
                                      child: Text(
                                        YBChineseText.mineAuthTitle,
                                        style: YBTextStyle.TextStyleA9AEB812,
                                      ),
                                    ),
                                    Container(
                                      width: YBTextStyle.adapterSize5,
                                    ),
                                    Container(
                                      child: Image.asset(YBImageStyle.getImagePath('mine_orgianAuth')),
                                    ),
                                    Container(
                                      width: YBTextStyle.adapterSize8,
                                    ),
                                    Container(
                                      child: Image.asset(YBImageStyle.getImagePath('findIconArrowRight')),
                                    )
                                  ],
                                ),
                              ),
                            ),
                          ),
                          onTap: (){
                            YBApplication.router.navigateTo(context, '/mine/mineQiYePersonPage');
                          },
                        ),
                        Container(
                          height: YBTextStyle.adapterSize8,
                        ),
                        InkWell(
                          child: Container(
                            color: YBColor.white,
                            height: YBTextStyle.adapterSize58,
                            child: Padding(
                              padding: EdgeInsets.only(left: YBTextStyle.adapterSize20,right: YBTextStyle.adapterSize20),
                              child: Row(
                                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                crossAxisAlignment: CrossAxisAlignment.center,
                                children: [
                                  Container(
                                    child: Text(
                                      YBChineseText.mineZuZhiManagerNumberTitle,
                                      style: YBTextStyle.TextStyle2F303314,
                                    ),
                                  ),
                                  Container(
                                    child: Image.asset(YBImageStyle.getImagePath('findIconArrowRight')),
                                  ),
                                ],
                              ),
                            ),
                          ),
                          onTap: (){
                            YBApplication.router.navigateTo(context, '/mine/mineQiYePersonPage/mineNumberManangerPage?orgcode=${zuZhiManagerModel.zuZhiManangerModel.orgCode}');
                          },
                        ),
                        InkWell(
                          child: Container(
                            color: YBColor.white,
                            height: YBTextStyle.adapterSize58,
                            child: Padding(
                              padding: EdgeInsets.only(left: YBTextStyle.adapterSize20,right: YBTextStyle.adapterSize20),
                              child: Row(
                                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                crossAxisAlignment: CrossAxisAlignment.center,
                                children: [
                                  Container(
                                    child: Text(
                                      YBChineseText.mineQuanCengHomeTitle,
                                      style: YBTextStyle.TextStyle2F303314,
                                    ),
                                  ),
                                  Container(
                                    child: Image.asset(YBImageStyle.getImagePath('findIconArrowRight')),
                                  ),
                                ],
                              ),
                            ),
                          ),
                          onTap: (){
                            YBApplication.router.navigateTo(context, '/mine/mineQiYePersonPage/mineQuanCengHomePage');
                          },
                        ),
                      ],
                    ),
                  );
                }
            ),
          ),
        ),
    );
  }
}
